
#pragma once
#include "stdafx.h"
#include "depend\FramesMgr.h"
#include "learn\LearnMgr.h"

class Game : public Singleton<Game>
{
public:
	Game() = default;
	virtual ~Game() = default;

public:
	bool init(GLFWwindow* window);
	void run(float);
	void release();

public:
	void changeGameRunningState()	{ m_pFramesMgr->changeRunningState(); };
	void changeGameFramesLogState()	{ m_pFramesMgr->changeFramesLogState(); };

protected:
	static void keyCallBack(GLFWwindow* window, int key, int scancode, int action, int modes);
	static void mouseButtonCallBack(GLFWwindow* window, int button, int action, int modes);
	static void cursorPosCallBack(GLFWwindow* window, double xPos, double yPos);
	static void scrollCallBack(GLFWwindow* window, double xOffset, double yOffset);

public:
	GLFWwindow* getWindow()	{ return m_window; }
	LearnNodePtr getLearnNodePtr() { return m_pContent->getLearnNodePtr(); }
	float getRunTime()	{ return m_pFramesMgr->m_running.m_fTotalTime; };

private:
	GLFWwindow* m_window;
	FramesMgrPtr m_pFramesMgr;

	KnowledgeContentPtr m_pContent;
};
